package com.TTBook.core.publisher.model;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class BookPublisherCriteria {
    protected String orderByClause;

    protected List oredCriteria;

    public BookPublisherCriteria() {
        oredCriteria = new ArrayList();
    }

    protected BookPublisherCriteria(BookPublisherCriteria example) {
        this.orderByClause = example.orderByClause;
        this.oredCriteria = example.oredCriteria;
    }

    public void setOrderByClause(String orderByClause) {
        this.orderByClause = orderByClause;
    }

    public String getOrderByClause() {
        return orderByClause;
    }

    public List getOredCriteria() {
        return oredCriteria;
    }

    public void or(Criteria criteria) {
        oredCriteria.add(criteria);
    }

    public Criteria createCriteria() {
        Criteria criteria = createCriteriaInternal();
        if (oredCriteria.size() == 0) {
            oredCriteria.add(criteria);
        }
        return criteria;
    }

    protected Criteria createCriteriaInternal() {
        Criteria criteria = new Criteria();
        return criteria;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table ts_book_publisher
     *
     *  Wed Oct 16 00:18:53 CST 2013
     */
    public void clear() {
        oredCriteria.clear();
    }

    public static class Criteria {
        protected List criteriaWithoutValue;

        protected List criteriaWithSingleValue;

        protected List criteriaWithListValue;

        protected List criteriaWithBetweenValue;

        protected Criteria() {
            super();
            criteriaWithoutValue = new ArrayList();
            criteriaWithSingleValue = new ArrayList();
            criteriaWithListValue = new ArrayList();
            criteriaWithBetweenValue = new ArrayList();
        }

        public boolean isValid() {
            return criteriaWithoutValue.size() > 0
                || criteriaWithSingleValue.size() > 0
                || criteriaWithListValue.size() > 0
                || criteriaWithBetweenValue.size() > 0;
        }

        public List getCriteriaWithoutValue() {
            return criteriaWithoutValue;
        }

        public List getCriteriaWithSingleValue() {
            return criteriaWithSingleValue;
        }

        public List getCriteriaWithListValue() {
            return criteriaWithListValue;
        }

        public List getCriteriaWithBetweenValue() {
            return criteriaWithBetweenValue;
        }

        protected void addCriterion(String condition) {
            if (condition == null) {
                throw new RuntimeException("Value for condition cannot be null");
            }
            criteriaWithoutValue.add(condition);
        }

        protected void addCriterion(String condition, Object value, String property) {
            if (value == null) {
                throw new RuntimeException("Value for " + property + " cannot be null");
            }
            Map map = new HashMap();
            map.put("condition", condition);
            map.put("value", value);
            criteriaWithSingleValue.add(map);
        }

        protected void addCriterion(String condition, List values, String property) {
            if (values == null || values.size() == 0) {
                throw new RuntimeException("Value list for " + property + " cannot be null or empty");
            }
            Map map = new HashMap();
            map.put("condition", condition);
            map.put("values", values);
            criteriaWithListValue.add(map);
        }

        protected void addCriterion(String condition, Object value1, Object value2, String property) {
            if (value1 == null || value2 == null) {
                throw new RuntimeException("Between values for " + property + " cannot be null");
            }
            List list = new ArrayList();
            list.add(value1);
            list.add(value2);
            Map map = new HashMap();
            map.put("condition", condition);
            map.put("values", list);
            criteriaWithBetweenValue.add(map);
        }

        public Criteria andPressidIsNull() {
            addCriterion("PRESSID is null");
            return this;
        }

        public Criteria andPressidIsNotNull() {
            addCriterion("PRESSID is not null");
            return this;
        }

        public Criteria andPressidEqualTo(String value) {
            addCriterion("PRESSID =", value, "pressid");
            return this;
        }

        public Criteria andPressidNotEqualTo(String value) {
            addCriterion("PRESSID <>", value, "pressid");
            return this;
        }

        public Criteria andPressidGreaterThan(String value) {
            addCriterion("PRESSID >", value, "pressid");
            return this;
        }

        public Criteria andPressidGreaterThanOrEqualTo(String value) {
            addCriterion("PRESSID >=", value, "pressid");
            return this;
        }

        public Criteria andPressidLessThan(String value) {
            addCriterion("PRESSID <", value, "pressid");
            return this;
        }

        public Criteria andPressidLessThanOrEqualTo(String value) {
            addCriterion("PRESSID <=", value, "pressid");
            return this;
        }

        public Criteria andPressidLike(String value) {
            addCriterion("PRESSID like", value, "pressid");
            return this;
        }

        public Criteria andPressidNotLike(String value) {
            addCriterion("PRESSID not like", value, "pressid");
            return this;
        }

        public Criteria andPressidIn(List values) {
            addCriterion("PRESSID in", values, "pressid");
            return this;
        }

        public Criteria andPressidNotIn(List values) {
            addCriterion("PRESSID not in", values, "pressid");
            return this;
        }

        public Criteria andPressidBetween(String value1, String value2) {
            addCriterion("PRESSID between", value1, value2, "pressid");
            return this;
        }

        public Criteria andPressidNotBetween(String value1, String value2) {
            addCriterion("PRESSID not between", value1, value2, "pressid");
            return this;
        }

        public Criteria andPressNameIsNull() {
            addCriterion("PRESS_NAME is null");
            return this;
        }

        public Criteria andPressNameIsNotNull() {
            addCriterion("PRESS_NAME is not null");
            return this;
        }

        public Criteria andPressNameEqualTo(String value) {
            addCriterion("PRESS_NAME =", value, "pressName");
            return this;
        }

        public Criteria andPressNameNotEqualTo(String value) {
            addCriterion("PRESS_NAME <>", value, "pressName");
            return this;
        }

        public Criteria andPressNameGreaterThan(String value) {
            addCriterion("PRESS_NAME >", value, "pressName");
            return this;
        }

        public Criteria andPressNameGreaterThanOrEqualTo(String value) {
            addCriterion("PRESS_NAME >=", value, "pressName");
            return this;
        }

        public Criteria andPressNameLessThan(String value) {
            addCriterion("PRESS_NAME <", value, "pressName");
            return this;
        }

        public Criteria andPressNameLessThanOrEqualTo(String value) {
            addCriterion("PRESS_NAME <=", value, "pressName");
            return this;
        }

        public Criteria andPressNameLike(String value) {
            addCriterion("PRESS_NAME like", value, "pressName");
            return this;
        }

        public Criteria andPressNameNotLike(String value) {
            addCriterion("PRESS_NAME not like", value, "pressName");
            return this;
        }

        public Criteria andPressNameIn(List values) {
            addCriterion("PRESS_NAME in", values, "pressName");
            return this;
        }

        public Criteria andPressNameNotIn(List values) {
            addCriterion("PRESS_NAME not in", values, "pressName");
            return this;
        }

        public Criteria andPressNameBetween(String value1, String value2) {
            addCriterion("PRESS_NAME between", value1, value2, "pressName");
            return this;
        }

        public Criteria andPressNameNotBetween(String value1, String value2) {
            addCriterion("PRESS_NAME not between", value1, value2, "pressName");
            return this;
        }
    }
}